package dev.ece.core.cells.alpha;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import dev.ece.core.cells.Cell;
import dev.ece.core.texture.FBOS;
import dev.ece.util.GLUtils;
import dev.ece.util.tools.Camera;

public interface Alpha extends Cell, AlphaEvent {

	public static final Logger LOG = LogManager.getLogger(Alpha.class);
	
	/**
	 * 渲染透明物体
	 * @param engine
	 * @param camera
	 */
	default void renderAlpha(FBOS defer, Camera camera) {
		GLUtils.glPushMatrix();
		try {
			this.calculate();
			this.onRenderAlpha(defer, camera);
		} catch(Exception e) {
			LOG.error("渲染透明物体错误.", e);
		}
		GLUtils.glPopMatrix();
	}
	
}
